<?php
include("../model/configuration.php");
include("../model/function.php");
if(isset($_SESSION['username']) and isset($_SESSION['password'])){

	$query=dbQuery("select username, password, pengguna.id_level from pengguna, level where pengguna.id_level = level.id_level order by username")or die(mysql_error());
	
	echo"<tr><td colspan='3'>&nbsp;</td></tr>";
	echo"<tr><td colspan='3'>Pencarian Obat</td></tr>";
	echo"<tr><td colspan='3'><hr color='#6d6a69'>&nbsp;</hr></td></tr>";

?>
	<table width="100%" border="1" cellpadding="3" cellspacing="1" align="center">
	<tr align="center">
		<td width="20%">ID Obat</td>
		<td width="20%">Nama Obat</td>
		<td width="20%">Stok</td>
		<td width="20%">Tanggal Masuk</td>
		<td width="20%">Nama Obat</td>
		<td width="20%">Harga Beli</td>
		<td width="20%">Expired Date</td>
		<td width="20%">Details Obat</td>
		<td width="20%">Gambar</td>
		<td width="20%">Status</td>
		<td width="20%">Satuan</td>
		<td width="20%">Bentuk</td>
		<td width="20%">ID Obat</td>
		<td width="20%">Nama Obat</td>
		<td width="20%">Harga Jual</td>
		<td width="20%" colspan="2">Action</td>
	</tr>
	<?php
	$order=1;
	while($data=dbAssoc($query)){
	?>
	<tr align="center">
		<td width="20%" align="center" ><?php print $data['username']; ?></td>
		<td width="20%" align="center" ><?php print $data['password']; ?></td>
		<td width="20%" align="center" ><?php print $data['id_level']; ?></td>
		<td><a href="obat_edit.php">UBAH DATA</a></td>
		<td><a onClick="<?php echo "return confirm('Yakin akan menghapus data $data[nama_obat] ?')"; ?>" href="user_delete.php">HAPUS DATA</a></td>
	</tr>
	<?php
	} $order++;
	?>
	<?php
}else{ 
header("Location:../administrator/test.html");
}
?>
